import { Application } from 'egg';

export default (app: Application) => {
  const mongoose = app.mongoose;
  const schema = new mongoose.Schema({
    name: {
      type: String,
      requied: true,
    },
    sort: {
      type: Number,
      requied: true,
    },
    type: {
      type: String,
      requied: true, // enjoy吃喝玩乐，preferential附近优惠，neighborhood邻里圈
    },
    status: {
      type: String,
      requied: true,
      default: 0, // 1:删除
    },
  });
  return mongoose.model('Category', schema, 'category');
};
